package edu.tms.crud;

import java.util.Date;

//日志
public class Logger {
	public static final int DEBUG=0;
	public static final int WARNING=1;
	public static final int ERROR=2;
	public static final int CHECK=3;
	
	private static int logTo=0;
	private static int level=0;
	static{
		String v=PropertyReader.get("logTo");
		logTo=Integer.parseInt(v);
		v=PropertyReader.get("logLevel");
		level=Integer.parseInt(v);

	}
	
	public static void log(int lvl,Object msg){
		switch(logTo){
		case 0:
			//不输出
			break;
		case 1:
			if(lvl>=level){
				System.out.print("###LOGTIME "+new Date()+" = ");
				System.out.println(msg);
			}
			break;
		case 2:
			//输出到文件
			break;
		}
	}
	
}
